var app = app || {};
app.easing = {};
app.easing.boxX = 145;
//app.easing.boxY = 180;
app.easing.startX = 0;
//app.easing.startY = 0;
app.easing.endX = 0;
//app.easing.endY = 0;

(function($) {
	$(function() {
		var $box = $('#box');
		$box.bind('touchstart click', touchStart);
		$box.bind('touchmove', touchMove);
		$box.bind('touchend', touchEnd);

		var $body = $('body');
		$body.bind('touchmove', function(e) {
			e.preventDefault();
		});
		
		$('#reset').bind('click', function(e){
			var $box = $('#box');
			$box.css('left', '150px');
		})
	});

	function touchStart(e) {
		var $box = $('#box');
		$box.css('-webkit-transition-duration','0s');
		
		var easingType = $('#easingType').val();
		$box.css('-webkit-transition-timing-function', easingType);
		$('#debug').html(easingType);
	}

	function touchMove(e) {
		var touch = event.touches[0];
		
		var $box = $('#box');
		$box.css('left', touch.pageX);
	}
	function touchEnd() {
		var $box = $('#box');
		$box.css('-webkit-transition-duration','2s');
		$box.css('left', '250px');
	}
})(jQuery);